import request from '@/utils/request'

/**
 * @description 获取员工列表
 * @param {*} params
 * @returns
 */
export const getEmployeeList = (params) => request({
  url: '/sys/user',
  method: 'GET',
  params
})

/**
 * @description 根据 id 删除员工
 * @param {*} id
 * @returns
 */
export const delEmployee = (id) => request({
  url: `/sys/user/${id}`,
  method: 'DELETE'
})

/**
 * @description 新增员工
 * @param {*} data
 * @returns
 */
export const addEmployee = (data) => request({
  url: '/sys/user',
  method: 'POST',
  data
})

/**
 * @description: 导入excel
 * @param {*} data
 * @return {*}
 */
export const importEmployee = (data) => request({
  url: '/sys/user/batch',
  method: 'POST',
  data
})

/**
 * @description: 保存员工基本信息
 * @param {*} data
 * @return {*}
 */
export const saveUserDetailById = (data) => request({
  url: `/sys/user/${data.id}`,
  method: 'put',
  data
})

